package drds.binlog.protocol.protocol_proto;

/**
 * Protobuf enum {@code com.alibaba.otter.canal.protocol.PacketType}
 */
public enum PacketType
        implements com.google.protobuf.ProtocolMessageEnum
{
    /**
     * <pre>
     * compatible
     * </pre>
     * <p>
     * <code>packagetypecompatibleproto2 = 0;</code>
     */
    packagetypecompatibleproto2(0),
    /**
     * <code>handshake = 1;</code>
     */
    handshake(1),
    /**
     * <code>clientauthentication = 2;</code>
     */
    clientauthentication(2),
    /**
     * <code>ack = 3;</code>
     */
    ack(3),
    /**
     * <code>subscription = 4;</code>
     */
    subscription(4),
    /**
     * <code>unsubscription = 5;</code>
     */
    unsubscription(5),
    /**
     * <code>get = 6;</code>
     */
    get(6),
    /**
     * <code>messages = 7;</code>
     */
    messages(7),
    /**
     * <code>clientack = 8;</code>
     */
    clientack(8),
    /**
     * <pre>
     * management part
     * </pre>
     * <p>
     * <code>shutdown = 9;</code>
     */
    shutdown(9),
    /**
     * <pre>
     * integration
     * </pre>
     * <p>
     * <code>dump = 10;</code>
     */
    dump(10),
    /**
     * <code>heartbeat = 11;</code>
     */
    heartbeat(11),
    /**
     * <code>clientrollback = 12;</code>
     */
    clientrollback(12),
    unrecognized(-1),;

    /**
     * <pre>
     * compatible
     * </pre>
     * <p>
     * <code>PACKAGETYPECOMPATIBLEPROTO2 = 0;</code>
     */
    public static final int packagetypecompatibleproto2_value = 0;
    /**
     * <code>handshake = 1;</code>
     */
    public static final int handshake_value = 1;
    /**
     * <code>clientauthentication = 2;</code>
     */
    public static final int clientauthentication_value = 2;
    /**
     * <code>ack = 3;</code>
     */
    public static final int ack_value = 3;
    /**
     * <code>subscription = 4;</code>
     */
    public static final int subscription_value = 4;
    /**
     * <code>unsubscription = 5;</code>
     */
    public static final int unsubscription_value = 5;
    /**
     * <code>get = 6;</code>
     */
    public static final int get_value = 6;
    /**
     * <code>messages = 7;</code>
     */
    public static final int messages_value = 7;
    /**
     * <code>clientack = 8;</code>
     */
    public static final int clientack_value = 8;
    /**
     * <pre>
     * management part
     * </pre>
     * <p>
     * <code>shutdown = 9;</code>
     */
    public static final int shutdown_value = 9;
    /**
     * <pre>
     * integration
     * </pre>
     * <p>
     * <code>dump = 10;</code>
     */
    public static final int dump_value = 10;
    /**
     * <code>heartbeat = 11;</code>
     */
    public static final int heartbeat_value = 11;
    /**
     * <code>clientrollback = 12;</code>
     */
    public static final int clientrollback_value = 12;
    private static final com.google.protobuf.Internal.EnumLiteMap<
            PacketType> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<PacketType>()
            {
                public PacketType findValueByNumber(int number)
                {
                    return PacketType.forNumber(number);
                }
            };
    private static final PacketType[] VALUES = values();
    private final int value;

    private PacketType(int value)
    {
        this.value = value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @Deprecated
    public static PacketType valueOf(int value)
    {
        return forNumber(value);
    }

    public static PacketType forNumber(int value)
    {
        switch (value)
        {
            case 0:
                return packagetypecompatibleproto2;
            case 1:
                return handshake;
            case 2:
                return clientauthentication;
            case 3:
                return ack;
            case 4:
                return subscription;
            case 5:
                return unsubscription;
            case 6:
                return get;
            case 7:
                return messages;
            case 8:
                return clientack;
            case 9:
                return shutdown;
            case 10:
                return dump;
            case 11:
                return heartbeat;
            case 12:
                return clientrollback;
            default:
                return null;
        }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<PacketType>
    internalGetValueMap()
    {
        return internalValueMap;
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptor()
    {
        return BinlogPacket.getDescriptor().getEnumTypes().get(1);
    }

    public static PacketType valueOf(
            com.google.protobuf.Descriptors.EnumValueDescriptor desc)
    {
        if (desc.getType() != getDescriptor())
        {
            throw new IllegalArgumentException(
                    "EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1)
        {
            return unrecognized;
        }
        return VALUES[desc.getIndex()];
    }

    public final int getNumber()
    {
        if (this == unrecognized)
        {
            throw new IllegalArgumentException(
                    "Can't get the number of an unknown enum value.");
        }
        return value;
    }

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
    getValueDescriptor()
    {
        return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptorForType()
    {
        return getDescriptor();
    }

    // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.PacketType)
}
